import request from "@/utils/request.js";


/**
 * 举例post请求
 * 用户发送验证码
 * @param data object 用户手机号
 */
export function registerVerify(data) {
	return request.post("register/verify", data, {
		noAuth: true,
	});
}


/**
 * 
 * 注册
 * @param data {"source":"1", "type":"1", "mobile":"13111112111", "password":"a123456", "code":"8868"}
 */
export function register(data) {
	return request.post("common/register", data, {
		noAuth: true
	});
}

/**
 * 
 * 登录
 * @param data {"source":"1", "type":"1", "mobile":"13111112111", "password":"a123456"}
 */
export function login(data) {
	return request.post("common/loginHandle", data, {
		noAuth: true
	});
}

/**
 * 
 * 微信登录
 * @param data {"code": "0e1xyFll2bkmsb4lajol2ASU7j2xyFlW", //获取openid对应的code"encrypted_data": "RMd5IyWurzSEqOzvA3YevubZhhKqP3pQLgynbyqkj/FybIQZdjC2uxbvFJxSo8WBs4cb6TG2JQL1I3K2dm4ILbusvEBLGOpBTyUJMR9D8XKz6jw0ZccrBjAZoxa+J7xHA4RM4HMPFaPRpKQWeWgiv0C1WWAcXQMFcHvuVPqDin4W3mZJ0Hyd4FG1CXAxYJI5nLQQp8tMUwbVoCexik971g==", //encryptedData"iv": "TIfp62NXNJM4vDuA49rNKA==", //iv"city": "天津" //所在城市
}
 */
export function wechatlogin(data) {
	return request.post("common/wxPhoneNumber", data, {
		noAuth: true
	});
}

/**
 * 
 * 获取验证码
 * @param data 
 * "type": "1", //类型 1：注册 2：登录 3：忘记密码 4：修改密码 5：修改手机号 6：更新手机号 7：报价联系人 
 * "mobile": "18822551986" //手机号
 */
export function smsCode(data) {
	return request.post("common/smsCode", data, {
		noAuth: true
	});
}


/**
 * 
 * 找回密码
 * @param data 
 * "type": "1", //类型 1：注册 2：登录 3：忘记密码 4：修改密码 
 * "mobile": "13111212111", //手机号 
 * "password": "a1234567", //密码 
 * "password_confirmation": "a1234567", //确认密码 
 * "code": "8868" //验证码
 */
export function findPassword(data) {
	return request.post("common/retrievePassword", data, {
		noAuth: true
	});
}
